/**
 * 滑动滚动条
 * @param {*} className 滚动容器类名
 * @param {*} slidingDistance 滑动的距离，没有传入，默认滑动到底部
 * @param {*} behavior 滚动方式
 */
export default function (className, slidingDistance, behavior = "smooth") {
  const dom = document.querySelector(className);
  const sTop = slidingDistance || slidingDistance === 0 ? slidingDistance : dom.scrollHeight;
  if (behavior === "smooth") {
    $(dom).animate({
      scrollTop: sTop
    }, 300);
    return;
  }

  dom.scrollTo({
    top: sTop,
    left: 0,
    behavior: behavior
  });
}
